<template>
	<view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad(e) {
			if(e && e.appId){
				let appId = e.appId;
				let path = e.appId ? e.appId : "";
				let extraData = e.extraData ? this.parseCustomStringToObject(e.extraData) : {};
				uni.navigateToMiniProgram({
					appId: appId,
					path: path,
					extraData: extraData,
					success: (res) => {}
				})
			}else{
				uni.showToast({
					title: '参数错误',
					duration: 2000
				});
				setTimeout(()=>{
					uni.navigateBack()
				},2000);
			}
		},
		methods: {
			parseCustomStringToObject(str) {
				const pairs = str.split(',');
				const obj = {};
				pairs.forEach(pair => {
					const [key, value] = pair.trim().split(':');
					obj[key] = value;
				});
				return obj;
			}
		}
	}
</script>

<style>

</style>
